package com.yc.txx.servlet;

import com.github.pagehelper.BoundSqlInterceptor;
import jdk.nashorn.internal.ir.RuntimeNode;

import javax.servlet.*;
import javax.servlet.annotation.WebFilter;

import java.io.IOException;
import java.util.logging.LogRecord;

@WebFilter(filterName = "EndcodingFilter",urlPatterns = "*.s")
public class EndcodingFilter implements Filter {

    @Override
    public void init(FilterConfig filterConfig) throws ServletException {
    }

    @Override
    public void doFilter(ServletRequest request, ServletResponse response, FilterChain FilterChain) throws IOException, ServletException {
        request.setCharacterEncoding("UTF-8");
        response.setCharacterEncoding("UTF-8");
        response.setContentType("application/json;charset=UTF-8");
        FilterChain.doFilter(request, response);
    }

    @Override
    public void destroy() {
    }
}
